using ClownFish;
using Microsoft.CSharp;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;

internal static class Class32
{
	[CompilerGenerated]
	private static Func<Class27, string> func_0;

	[CompilerGenerated]
	private static Func<Class27, Type> func_1;

	private static void smethod_0(Assembly assembly_0, StringCollection stringCollection_0)
	{
		string location = assembly_0.Location;
		if (!stringCollection_0.Contains(location))
		{
			stringCollection_0.Add(location);
		}
	}

	public static Assembly smethod_1(List<Class27> list_0)
	{
		if (list_0 == null || list_0.Count == 0)
		{
			throw new ArgumentException("list is null or empty.");
		}
		CompilerParameters compilerParameters = new CompilerParameters();
		compilerParameters.GenerateExecutable = false;
		compilerParameters.GenerateInMemory = true;
		Assembly[] array = Class29.smethod_0();
		for (int i = 0; i < array.Length; i++)
		{
			Assembly assembly_ = array[i];
			Class32.smethod_0(assembly_, compilerParameters.ReferencedAssemblies);
		}
		Class32.smethod_0(typeof(string).Assembly, compilerParameters.ReferencedAssemblies);
		Class32.smethod_0(typeof(DataTable).Assembly, compilerParameters.ReferencedAssemblies);
		Class32.smethod_0(typeof(Queryable).Assembly, compilerParameters.ReferencedAssemblies);
		Class32.smethod_0(typeof(DbContext).Assembly, compilerParameters.ReferencedAssemblies);
		if (Class32.func_0 == null)
		{
			Class32.func_0 = new Func<Class27, string>(Class32.smethod_2);
		}
		string[] sources = list_0.Select(Class32.func_0).ToArray<string>();
		CSharpCodeProvider cSharpCodeProvider = (CSharpCodeProvider)CodeDomProvider.CreateProvider("CSharp");
		CompilerResults compilerResults = cSharpCodeProvider.CompileAssemblyFromSource(compilerParameters, sources);
		if (compilerResults.Errors != null && compilerResults.Errors.HasErrors)
		{
			if (Class32.func_1 == null)
			{
				Class32.func_1 = new Func<Class27, Type>(Class32.smethod_3);
			}
			Type[] type_ = list_0.Select(Class32.func_1).ToArray<Type>();
			throw new CompileException("ClownFish's AutoLoader Code Compile Error.", compilerResults.Errors, type_);
		}
		return compilerResults.CompiledAssembly;
	}

	[CompilerGenerated]
	private static string smethod_2(Class27 class27_0)
	{
		return class27_0.string_0;
	}

	[CompilerGenerated]
	private static Type smethod_3(Class27 class27_0)
	{
		return class27_0.class26_0.type_0;
	}
}
